#ifndef HISTORY_H
#define HISTORY_H

#include <QWidget>
#include <QVector>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QTimer>
#include "qcustomplot.h"
#include "mqtt/qmqtt.h"
#include <QDateTime>

#include "set.h"

namespace Ui {
class history;
}

class history : public QWidget
{
    Q_OBJECT

public:
    explicit history(QWidget *parent = 0);
    ~history();

    QDateTime time_start;
    QDateTime time_stop;

    //设置qcustomplot画图属性，实时
    void setupRealtimeDataDemo(QCustomPlot *customPlot);


private:
    Ui::history *ui;
    //定时器，周期调用realtimeDataSlot()槽，实现动态数据添加到曲线
    QTimer dataTimer;

    QVector<double> speedval;
    QVector<double> temperatureval;

signals:



private slots:
    void Push_his_Slot();  // 查询历史数据按钮槽函数

    void hisSlot(QByteArray);  // 向图表中写入数据

};

#endif // HISTORY_H
